package com.ytkj.digitalConstruction.service.assets;

import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ytkj.digitalConstruction.entity.assets.Device;
import com.ytkj.digitalConstruction.redis.RedisHashService;
import com.ytkj.digitalConstruction.redis.RedisListService;

@Service
public class TestService {
    
    @Autowired
    protected RedisHashService<Device> redisHashService;
    
    @Autowired
    protected RedisListService<Device> redisListService;
    
    
    public void addDevice(){
        List<Device> devices = new ArrayList<Device>();
        for(int i=0;i<10;i++){
            Device dv = new Device();
            dv.setDeviceId(i);
            dv.setProjectId(i);
            dv.setDeviceName("设备名称"+i);
            dv.setStatus(i);
            devices.add(dv);
        }
        redisListService.pushAll("testlist", devices);
        //Map<String,Device> d= redisHashService.entries("dv1");
        //return d;
    }
}
